package tech.aistar.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.aistar.entity.ParperBank;
import tech.aistar.entity.Questionpaper;
import tech.aistar.mapper.TestPaperMapper;
import tech.aistar.service.TestPaperService;

import java.util.List;

@Service
public class TestPaperSerivceImpl implements TestPaperService {
    @Autowired
    private TestPaperMapper testPaperMapper;
    @Override
    public List<String> findlanguage() {
        return testPaperMapper.findlanguage();
    }

    @Override
    public List<String> finddiff() {
        return testPaperMapper.finddiff();
    }

    @Override
    public List<String> findPaper() {
        return testPaperMapper.findPaper();
    }

    @Override
    public List<ParperBank> findAll() {
        return testPaperMapper.findAll();
    }

    public PageInfo<ParperBank> findbypage(int pagenum, int pagesize){
        PageHelper.startPage(pagenum,pagesize);
        List<ParperBank> parperBanks = findAll();
        PageInfo<ParperBank> parperBankPageInfo = new PageInfo<>(parperBanks);
        return parperBankPageInfo;
    }
    @Override
    public List<Integer> findParperId() {
        return testPaperMapper.findParperId();
    }
}
